package com.emergency.base.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;

/**
 * 计划明细类
 */
@Entity
@Table(name="bus_plan_detail")
public class PlanDetail extends BaseEntity{

	/**指令动作*/
	@OneToOne(targetEntity=Order.class,fetch= FetchType.LAZY)
	@JoinColumn(name="order_id",referencedColumnName="id")
	private Order order;

	@JsonIgnore
	@OneToOne(targetEntity=Plan.class,fetch= FetchType.LAZY)
	@JoinColumn(name="plan_id",referencedColumnName="id")
	private Plan plan;

	/**指令名称*/
	private String orderName;

	/**指令具体信息*/
	private String orderDetail;

	/**指令状态 0未开始，1执行中，2已结束*/
	private int status;

	private int level;

	private boolean hasChild;

	private String description;

	//所属分队
	@OneToOne(targetEntity=Army.class,fetch= FetchType.LAZY)
	@JoinColumn(name="army_id",referencedColumnName="id")
	private Army army;

	/**开始时间*/
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date startTime;

	/**结束时间*/
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date endTime;

	/**时长*/
	private long time;

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public String getOrderName() {
		return orderName;
	}

	public void setOrderName(String orderName) {
		this.orderName = orderName;
	}

	public Plan getPlan() {
		return plan;
	}

	public void setPlan(Plan plan) {
		this.plan = plan;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public boolean isHasChild() {
		return hasChild;
	}

	public void setHasChild(boolean hasChild) {
		this.hasChild = hasChild;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Army getArmy() {
		return army;
	}

	public void setArmy(Army army) {
		this.army = army;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public String getOrderDetail() {
		return orderDetail;
	}

	public void setOrderDetail(String orderDetail) {
		this.orderDetail = orderDetail;
	}
}